<template>
  <el-dialog :title="$t('flycare.statement.generate_result_title')" width="50%">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column
        prop="platCode"
        :label="$t('modules.contract.plat')"
        
      >
        <template v-slot="scope">
          {{ $t("contract_plat." + scope.row.platCode) }}
        </template>
      </el-table-column>
      <el-table-column
        prop="billingServiceCode"
        :label="$t('modules.contract.billing_method')"
        
      >
        <template v-slot="scope">
          {{ $t("flycare.billing_service." + scope.row.billingServiceCode + ".name") }}
        </template>
      </el-table-column>
      <el-table-column
        prop="statementMonth"
        :label="$t('flycare.statement.generate_month')"
        
        >{{ statementMonth }}</el-table-column
      >
      <el-table-column
        prop="resultCode"
        :label="$t('flycare.result_title')"
        
      >
        <template v-slot="scope">
          {{ $t("flycare.statement.gen_result_code." + scope.row.resultCode) }}
        </template>
      </el-table-column> </el-table
    ><template #footer>
      <span class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          :loading="confirmLoading"
          @click="closeDialog"
          >{{ $t("common.confirm") }}</el-button
        >
      </span></template
    >
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      confirmLoading: false,
      statementGenerateResult: null,
      statementMonth: "",
      tableData: [],
    };
  },
  methods: {
    openDialog(statementGenerateResult) {
      this.tableData = statementGenerateResult.genFailedService;
      this.statementMonth = statementGenerateResult.statementMonth;
    },
    closeDialog() {
      this.$emit("update:model-value", false);
    },
  },
};
</script>
